import request from '../utils/request';

/**
 * 获取购物车列表
 */
export const getCartListApi = () => {
  return request(`/cart/getCartList`);
}

/**
 * 更新购物车商品数量
 */
export const updateCartCountApi = (goodsId, count) => {
  return request(`/cart/addToCart/${goodsId}/${count}`);
}

/**
 * 更新购物车商品全选和全不选
 */
export const updateCheckAllApi = (isChecked) => {
  return request(`/cart/checkAllCart/${isChecked}`);
}

/**
 * 更新购物车商品单选
 */
export const updateCartCheckApi = (goodsId, isChecked) => {
  return request(`/cart/checkCart/${goodsId}/${isChecked}`);
}

/**
 * 删除购物车商品
 */
export const delCartApi = (goodsId) => {
  return request(`/cart/delete/${goodsId}`);
}
